An optical encoder (such as an optical rotary encoder, an optical scale, and so on hereafter referred to as an optical encoder in the specification) could be an incremental type optical encoder or an absolute type optical encoder according to its output configurations. The absolute type optical encoder could directly output an absolute value of a displacement coordinate without any error accumulation. The minimum measureable unit of the incremental type optical encoder is based on the incremental grating. The output of the incremental signal could be an orthogonal output signal (for example, a sinusoidal signal or a cosine signal), by which a receiving end could calculate with a high-resolution interpolation, so as to obtain more detailed displacement resolution information than that provided by the absolute type optical encoder. Therefore, how to design an incremental type optical encoder is one of important topics for the industry.